Filter hook 'rest_pre_insert_{$this->post_type}'

in WP Core File wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php at line 1405

Description

Filters a post before it is inserted via the REST API. The dynamic portion of the hook name, `$this->post_type`, refers to the post type slug. Possible hook names include: - `rest_pre_insert_post` - `rest_pre_insert_page` - `rest_pre_insert_attachment`

Occurrences

Filename Line Number
wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php 1405
wp-includes/rest-api/endpoints/class-wp-rest-templates-controller.php 656

Parameters

Type Name Description
stdClass $prepared_post An object representing a single post prepared for inserting or updating the database.
WP_REST_Request $request Request object.

PHP Doc

/**
		 * Filters a post before it is inserted via the REST API.
		 *
		 * The dynamic portion of the hook name, `$this->post_type`, refers to the post type slug.
		 *
		 * Possible hook names include:
		 *
		 *  - `rest_pre_insert_post`
		 *  - `rest_pre_insert_page`
		 *  - `rest_pre_insert_attachment`
		 *
		 * @since 4.7.0
		 *
		 * @param stdClass        $prepared_post An object representing a single post prepared
		 *                                       for inserting or updating the database.
		 * @param WP_REST_Request $request       Request object.
		 */